
//
//  CollectionViewGameCell.swift
//  DouYuZB
//
//  Created by DSDL on 2016/11/3.
//  Copyright © 2016年 鼎商动力. All rights reserved.
//

import UIKit
import Kingfisher
class CollectionViewGameCell: UICollectionViewCell {
    
    //MARK: - 定义控件属性
    @IBOutlet weak var titleLabel: UILabel!
    @IBOutlet weak var iconImageView: UIImageView!
    var basegame:BaseGameModel?{
        
        didSet{
            titleLabel.text = basegame?.tag_name
            if let iconurl =  URL(string: basegame?.icon_url ?? "")
            {
                iconImageView.kf.setImage(with: iconurl)
            }else{
                iconImageView.image = UIImage(named: "home_more_btn")
            }
        }
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        self.layoutIfNeeded() //刷新出正确的位置
        iconImageView.layer.cornerRadius =  iconImageView.bounds.width / 2
        iconImageView.layer.masksToBounds = true
    }
}
